#include "guiterm.hpp"

JobContextMenu::JobContextMenu(RemoteJob *job)
{
	connect(this, SIGNAL(aboutToHide()), this, SLOT(deleteLater()));
	
	QAction *sendInt = addAction("Interrupt job");
	sendInt->setShortcut(Qt::CTRL+Qt::Key_C);
	connect(sendInt, SIGNAL(triggered()), job, SLOT(interrupt()));
	
	QAction *sendTerm = addAction("Terminate job");
	sendTerm->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_C);
	connect(sendTerm, SIGNAL(triggered()), job, SLOT(terminate()));
	
	QAction *sendKill = addAction("Kill job");
	sendKill->setShortcut(Qt::CTRL+Qt::ALT+Qt::Key_C);
	connect(sendKill, SIGNAL(triggered()), job, SLOT(kill()));
	
	QAction *sendPause = addAction("Pause job");
	sendPause->setShortcut(Qt::CTRL+Qt::Key_Z);
	connect(sendPause, SIGNAL(triggered()), job, SLOT(pause()));
	
	QAction *newWindow = addAction("Move to new window");
	connect(newWindow, SIGNAL(triggered()), job->getView(), SLOT(moveToNewWindow()));
}

